package cn.qyd.javaarray;


import com.sun.xml.internal.ws.api.model.wsdl.WSDLOutput;

import java.util.Arrays;
import java.util.stream.Stream;

/**
 * @author 邱运铎
 * @date 2024-03-05 13:03
 */
public class PrintArrayDemo {
    public static void main(String[] args) {
        String[] array = new String[]{"邱运铎","程序员","Java"};
        System.out.println("Arrays.asList(数组对象).stream().forEach打印: ");
        Arrays.asList(array).stream().forEach( str -> System.out.println(str));
        System.out.println("Stream.of(数组对象).forEach打印: ");
        Stream.of(array).forEach(str -> System.out.println(str));
        Stream.of(array).forEach(System.out::println);
        System.out.println("Arrays.stream(数组对象).forEach()打印");
        Arrays.stream(array).forEach(System.out::println);
        System.out.println("Arrays.toString()打印");
        System.out.println(Arrays.toString(array));

        String[][] arrays = new String[][]{{"qiuyunduo","man"},{"邱运铎","男"}};
        System.out.println("打印二维数组，Arrays.toString()");
        System.out.println(Arrays.toString(arrays));
        System.out.println("打印二维数组，Arrays.deepToString()");
        System.out.println(Arrays.deepToString(arrays));
    }


}
